from vector import *
from mapa import *
def canPass(p):
    pos1 = p.split("x")
    for i in col:
        pos2 = i.split("x")
        if pos1[0] >= pos2[0] and pos1[0] <= pos2[0]+10 and pos1[1] >= pos2[1] and pos1[1]<=pos2[1]+10:
            return False
    print "True"
    return True
def ray(start,end):
    start = vector(int(start.get()[0]/10)*10,int(start.get()[1]/10))
    end = vector(int(end.get()[0]/10),int(end.get()[1]/10))
    for x in range(start.get()[0],end.get()[0]):
        for y in range(start.get()[1],end.get()[1]):
            if canPass(str(x)+"x"+str(y)):
                pass
            else:
                return vector(x*10,y*10)
    end = vector(int(end.get()[0]*10),int(end.get()[1]*10))
    return end
